<cpanel include="../../config.php">

<?

/***************************************************************************
 *                                 forwarders_edit.php
 *                            -------------------
 *   Begin                : Thursday, April 16, 2005
 *   Copyright            : (C) 2005 Point and Code
 *   Domain               : http://www.pointandcode.com/
 *   Email                : support@pointandcode.com
 *   Version              : 1.0.0
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

$html_root_path = '../../';
$page_title = "Edit Forwarder";
include $root_path.'common.php';
include $root_path.'page_header.php';

$template->set_filenames(array(
	'body' => $root_path.$template_path.'mail/forwarders_edit.tpl')
);


// Guess what? We need to decompile this function, add in a selected, then recompile it. How nice!
$domains = <<<EOFpacman
<cpanel Email="printdomainoptions()">
EOFpacman;

$domains = explode("</option>", $domains);

$s_domains = '';
$i = 0;

foreach ($domains as $row) {
	$temp = explode('<option value="', $row);
	$temp2 = explode('">', $temp[1]);
	$domain_name = $temp2[0];
	
	if ($domain_name!='') {
		
		$s_domains .= '<option value="'.$domain_name.'"';
		
		if ($domain_name == $HTTP_GET_VARS['domain']) {
			$s_domains .= ' selected="selected"';
		};
		
		$s_domains .= '>'.$domain_name.'</option>';
	};

	$i++;
};

$s_hidden_fields = '<input type=hidden name=email_delete value="'.$HTTP_GET_VARS['address'].'@'.$HTTP_GET_VARS['domain'].'='.$HTTP_GET_VARS['forward'].'">';

$template->assign_vars(array(
	'S_ACTION' => "forwarders_edit_done.php",
	'S_DOMAINS' => $s_domains,
	'S_HIDDEN_FIELDS' => $s_hidden_fields,
	
	'ADDRESS' => $HTTP_GET_VARS['address'],
	'FORWARD' => $HTTP_GET_VARS['forward'],
));

//
// Woohoo! All done!
//
$template->pparse('body');




include $root_path.'page_tail.php';


?>